package bb.lanxing.lib.devices.ble.ble.characteristic.light;

import kotlin.jvm.internal.DefaultConstructorMarker;

public enum LightControlPointResultOpCode {
    reserved((short)0),
    success((short)1),
    opCodeNotSupported((short)2),
    invalidParameter((short)3),
    operationFailed((short)4),
    controlNotPermitted((short)5),
    timeout((short)31);
    
    public static final Companion Companion = new Companion(null);
    private final short value;

    LightControlPointResultOpCode(short s) {
        this.value = s;
    }

    public final short getValue() {
        return this.value;
    }


    public static final class Companion {
        public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public LightControlPointResultOpCode from(byte b) {
            LightControlPointResultOpCode lightControlPointResultOpCode;
            LightControlPointResultOpCode[] values = LightControlPointResultOpCode.values();
            int length = values.length;
            int i = 0;
            while (true) {
                if (i >= length) {
                    lightControlPointResultOpCode = null;
                    break;
                }
                lightControlPointResultOpCode = values[i];
                if (((byte) lightControlPointResultOpCode.getValue()) == b) {
                    break;
                }
                i++;
            }
            return lightControlPointResultOpCode == null ? LightControlPointResultOpCode.reserved : lightControlPointResultOpCode;
        }
    }
}
